package security;

import java.io.*;
import java.net.*;
import java.rmi.server.*;

public class CipherClientSocketFactory
		implements RMIClientSocketFactory, Serializable
{
	

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public CipherClientSocketFactory() {
	}

	public Socket createSocket( String host, int port) throws IOException {
		return new CipherSocket(host, port);
	}

	public int hashCode() {
		return KeyManager.getInstance().getPattern();
	}

	public boolean equals( Object obj) {
		return (getClass() == obj.getClass() && KeyManager.getInstance().getPattern() == ((CipherClientSocketFactory)obj).hashCode());
	}

}
